package fei.yuzhi.com.loveflowers.fragment.mefragment.login;

import fei.yuzhi.com.loveflowers.fragment.mefragment.login.register.UserBean;

/**
 * Created by Administrator on 2016/10/7.
 */
public class LoginPresenter implements LoginContract.PresenterLogin{

    private LoginContract.ViewLogin view;
    private LoginContract.ModelLogin model;
    public LoginPresenter(LoginContract.ViewLogin view) {
        this.view=view;
        this.model=new LoginModel();
    }

    @Override
    public void userLogin(String name,String pass) {
        model.userLogin(name, pass, new LoginModel.userLogin() {
            @Override
            public void getLoginRegisterAccesss(String msg, UserBean user) {
                view.onVerticalSucess(msg,user);
            }

            @Override
            public void getLoginRegisterFail(String msg) {
                view.onVerticalFail(msg);
            }
        });

    }
}
